home *** CD-ROM | disk | FTP | other *** search
/ Complete Internet Archive / Complete Internet Archive.iso / Winsock Libraries / ipack(2).exe / ENCODE.FRM (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1997-01-08  |  11.5 KB  |  353 lines

  1. VERSION 4.00
  2. Begin VB.Form Form1 
  3.    Caption         =   "File Encoder / Decoder"
  4.    ClientHeight    =   4920
  5.    ClientLeft      =   2715
  6.    ClientTop       =   2535
  7.    ClientWidth     =   7845
  8.    BeginProperty Font 
  9.       name            =   "Courier New"
  10.       charset         =   0
  11.       weight          =   400
  12.       size            =   8.25
  13.       underline       =   0   'False
  14.       italic          =   0   'False
  15.       strikethrough   =   0   'False
  16.    EndProperty
  17.    ForeColor       =   &H80000008&
  18.    Height          =   5325
  19.    Left            =   2655
  20.    LinkTopic       =   "Form1"
  21.    LockControls    =   -1  'True
  22.    ScaleHeight     =   4920
  23.    ScaleWidth      =   7845
  24.    Top             =   2190
  25.    Width           =   7965
  26.    Begin VB.CommandButton cmdExit 
  27.       Caption         =   "E&xit"
  28.       BeginProperty Font 
  29.          name            =   "MS Sans Serif"
  30.          charset         =   0
  31.          weight          =   400
  32.          size            =   8.25
  33.          underline       =   0   'False
  34.          italic          =   0   'False
  35.          strikethrough   =   0   'False
  36.       EndProperty
  37.       Height          =   375
  38.       Left            =   4800
  39.       TabIndex        =   4
  40.       Top             =   1200
  41.       Width           =   2775
  42.    End
  43.    Begin VB.CommandButton cmdDecode 
  44.       Caption         =   "&Decode File"
  45.       BeginProperty Font 
  46.          name            =   "MS Sans Serif"
  47.          charset         =   0
  48.          weight          =   400
  49.          size            =   8.25
  50.          underline       =   0   'False
  51.          italic          =   0   'False
  52.          strikethrough   =   0   'False
  53.       EndProperty
  54.       Height          =   375
  55.       Left            =   4800
  56.       TabIndex        =   11
  57.       Top             =   720
  58.       Width           =   2775
  59.    End
  60.    Begin VB.CommandButton cmdEncode 
  61.       Caption         =   "&Encode File"
  62.       BeginProperty Font 
  63.          name            =   "MS Sans Serif"
  64.          charset         =   0
  65.          weight          =   400
  66.          size            =   8.25
  67.          underline       =   0   'False
  68.          italic          =   0   'False
  69.          strikethrough   =   0   'False
  70.       EndProperty
  71.       Height          =   375
  72.       Left            =   4800
  73.       TabIndex        =   10
  74.       Top             =   240
  75.       Width           =   2775
  76.    End
  77.    Begin VB.Frame Frame1 
  78.       Caption         =   "Encoding / Decoding Type"
  79.       BeginProperty Font 
  80.          name            =   "MS Sans Serif"
  81.          charset         =   0
  82.          weight          =   400
  83.          size            =   8.25
  84.          underline       =   0   'False
  85.          italic          =   0   'False
  86.          strikethrough   =   0   'False
  87.       EndProperty
  88.       Height          =   1575
  89.       Left            =   240
  90.       TabIndex        =   5
  91.       Top             =   1320
  92.       Width           =   4215
  93.       Begin VB.OptionButton optEncoding 
  94.          Caption         =   "Quoted-Printable"
  95.          BeginProperty Font 
  96.             name            =   "MS Sans Serif"
  97.             charset         =   0
  98.             weight          =   400
  99.             size            =   8.25
  100.             underline       =   0   'False
  101.             italic          =   0   'False
  102.             strikethrough   =   0   'False
  103.          EndProperty
  104.          Height          =   255
  105.          Index           =   3
  106.          Left            =   240
  107.          TabIndex        =   9
  108.          Top             =   1080
  109.          Width           =   2200
  110.       End
  111.       Begin VB.OptionButton optEncoding 
  112.          Caption         =   "BinHex"
  113.          BeginProperty Font 
  114.             name            =   "MS Sans Serif"
  115.             charset         =   0
  116.             weight          =   400
  117.             size            =   8.25
  118.             underline       =   0   'False
  119.             italic          =   0   'False
  120.             strikethrough   =   0   'False
  121.          EndProperty
  122.          Height          =   255
  123.          Index           =   2
  124.          Left            =   240
  125.          TabIndex        =   8
  126.          Top             =   840
  127.          Width           =   2200
  128.       End
  129.       Begin VB.OptionButton optEncoding 
  130.          Caption         =   "UU encode/decode"
  131.          BeginProperty Font 
  132.             name            =   "MS Sans Serif"
  133.             charset         =   0
  134.             weight          =   400
  135.             size            =   8.25
  136.             underline       =   0   'False
  137.             italic          =   0   'False
  138.             strikethrough   =   0   'False
  139.          EndProperty
  140.          Height          =   255
  141.          Index           =   1
  142.          Left            =   240
  143.          TabIndex        =   7
  144.          Top             =   600
  145.          Width           =   2200
  146.       End
  147.       Begin VB.OptionButton optEncoding 
  148.          Caption         =   "Base64 (MIME)"
  149.          BeginProperty Font 
  150.             name            =   "MS Sans Serif"
  151.             charset         =   0
  152.             weight          =   400
  153.             size            =   8.25
  154.             underline       =   0   'False
  155.             italic          =   0   'False
  156.             strikethrough   =   0   'False
  157.          EndProperty
  158.          Height          =   255
  159.          Index           =   0
  160.          Left            =   240
  161.          TabIndex        =   6
  162.          Top             =   360
  163.          Value           =   -1  'True
  164.          Width           =   2200
  165.       End
  166.    End
  167.    Begin VB.TextBox txtDstFilename 
  168.       BeginProperty Font 
  169.          name            =   "MS Sans Serif"
  170.          charset         =   0
  171.          weight          =   400
  172.          size            =   8.25
  173.          underline       =   0   'False
  174.          italic          =   0   'False
  175.          strikethrough   =   0   'False
  176.       EndProperty
  177.       Height          =   285
  178.       Left            =   240
  179.       TabIndex        =   2
  180.       Text            =   "c:\temp\autoexec.ba2"
  181.       Top             =   960
  182.       Width           =   4215
  183.    End
  184.    Begin VB.TextBox txtSrcFilename 
  185.       BeginProperty Font 
  186.          name            =   "MS Sans Serif"
  187.          charset         =   0
  188.          weight          =   400
  189.          size            =   8.25
  190.          underline       =   0   'False
  191.          italic          =   0   'False
  192.          strikethrough   =   0   'False
  193.       EndProperty
  194.       Height          =   285
  195.       Left            =   240
  196.       TabIndex        =   0
  197.       Text            =   "c:\temp\autoexec.out"
  198.       Top             =   360
  199.       Width           =   4215
  200.    End
  201.    Begin MailLib.mMail Mail1 
  202.       Left            =   0
  203.       Top             =   0
  204.       _Version        =   327680
  205.       _ExtentX        =   847
  206.       _ExtentY        =   847
  207.       _StockProps     =   0
  208.       Blocking        =   0   'False
  209.       Debug           =   0
  210.       Host            =   ""
  211.       Timeout         =   0
  212.       ConnectType     =   0
  213.       PopPort         =   110
  214.       SmtpPort        =   25
  215.    End
  216.    Begin VB.Label Label4 
  217.       Caption         =   "To decode a file, follow the same procedure as Encoding.  Except, push the ""Decode File"" button."
  218.       BeginProperty Font 
  219.          name            =   "MS Sans Serif"
  220.          charset         =   0
  221.          weight          =   400
  222.          size            =   8.25
  223.          underline       =   0   'False
  224.          italic          =   0   'False
  225.          strikethrough   =   0   'False
  226.       EndProperty
  227.       Height          =   495
  228.       Left            =   240
  229.       TabIndex        =   13
  230.       Top             =   4320
  231.       Width           =   4215
  232.    End
  233.    Begin VB.Label Label3 
  234.       Caption         =   $"ENCODE.frx":0000
  235.       BeginProperty Font 
  236.          name            =   "MS Sans Serif"
  237.          charset         =   0
  238.          weight          =   400
  239.          size            =   8.25
  240.          underline       =   0   'False
  241.          italic          =   0   'False
  242.          strikethrough   =   0   'False
  243.       EndProperty
  244.       Height          =   1215
  245.       Left            =   240
  246.       TabIndex        =   12
  247.       Top             =   3000
  248.       Width           =   4215
  249.    End
  250.    Begin VB.Label Label2 
  251.       Caption         =   "Destination Filename:"
  252.       BeginProperty Font 
  253.          name            =   "MS Sans Serif"
  254.          charset         =   0
  255.          weight          =   400
  256.          size            =   8.25
  257.          underline       =   0   'False
  258.          italic          =   0   'False
  259.          strikethrough   =   0   'False
  260.       EndProperty
  261.       Height          =   255
  262.       Left            =   240
  263.       TabIndex        =   3
  264.       Top             =   720
  265.       Width           =   3015
  266.    End
  267.    Begin VB.Label Label1 
  268.       Caption         =   "Source Filename:"
  269.       BeginProperty Font 
  270.          name            =   "MS Sans Serif"
  271.          charset         =   0
  272.          weight          =   400
  273.          size            =   8.25
  274.          underline       =   0   'False
  275.          italic          =   0   'False
  276.          strikethrough   =   0   'False
  277.       EndProperty
  278.       Height          =   255
  279.       Left            =   240
  280.       TabIndex        =   1
  281.       Top             =   120
  282.       Width           =   1695
  283.    End
  284. Attribute VB_Name = "Form1"
  285. Attribute VB_Creatable = False
  286. Attribute VB_Exposed = False
  287. Option Explicit
  288. Private Sub cmdDecode_Click()
  289.    If Trim(txtSrcFilename.Text) = "" Then
  290.       MsgBox "You must specify a source filename."
  291.       Exit Sub
  292.       End If
  293.    If Trim(txtDstFilename.Text) = "" Then
  294.       MsgBox "You must specify a destination filename."
  295.       Exit Sub
  296.       End If
  297.    Mail1.SrcFilename = txtSrcFilename.Text
  298.    Mail1.DstFilename = txtDstFilename.Text
  299.    Mail1.Flags = MailSrcIsFile Or MailDstIsFile
  300.    If optEncoding(0).Value Then
  301.       Mail1.ContentTransferEncoding = "base64"
  302.    ElseIf optEncoding(1).Value Then
  303.       Mail1.ContentTransferEncoding = "x-uuencode"
  304.    ElseIf optEncoding(2).Value Then
  305.       Mail1.ContentTransferEncoding = "mac-binhex40"
  306.    ElseIf optEncoding(3).Value Then
  307.       Mail1.ContentTransferEncoding = "quoted-printable"
  308.       End If
  309.    On Error Resume Next
  310.    Err = 0
  311.    Mail1.Action = MailActionDecode
  312.    If Err = 0 Then
  313.       MsgBox "Decoding complete."
  314.    Else
  315.       MsgBox "Decoding error (" & Err & ") - '" & Error & "'."
  316.       End If
  317.    On Error GoTo 0
  318.    End Sub
  319. Private Sub cmdEncode_Click()
  320.    If Trim(txtSrcFilename.Text) = "" Then
  321.       MsgBox "You must specify a source filename."
  322.       Exit Sub
  323.       End If
  324.    If Trim(txtDstFilename.Text) = "" Then
  325.       MsgBox "You must specify a destination filename."
  326.       Exit Sub
  327.       End If
  328.    Mail1.SrcFilename = txtSrcFilename.Text
  329.    Mail1.DstFilename = txtDstFilename.Text
  330.    Mail1.Flags = MailSrcIsFile Or MailDstIsFile
  331.    If optEncoding(0).Value Then
  332.       Mail1.ContentTransferEncoding = "base64"
  333.    ElseIf optEncoding(1).Value Then
  334.       Mail1.ContentTransferEncoding = "x-uuencode"
  335.    ElseIf optEncoding(2).Value Then
  336.       Mail1.ContentTransferEncoding = "mac-binhex40"
  337.    ElseIf optEncoding(3).Value Then
  338.       Mail1.ContentTransferEncoding = "quoted-printable"
  339.       End If
  340.    On Error Resume Next
  341.    Err = 0
  342.    Mail1.Action = MailActionEncode
  343.    If Err = 0 Then
  344.       MsgBox "Encoding complete."
  345.    Else
  346.       MsgBox "Encoding error (" & Err & ") - '" & Error & "'."
  347.       End If
  348.    On Error GoTo 0
  349.    End Sub
  350. Private Sub cmdExit_Click()
  351.    End
  352.    End Sub
  353.